package cn.com.agree.order.utils;

import javax.persistence.criteria.CriteriaBuilder;
import java.util.Random;

/**
 * Descriptions...
 *
 * @author sun.ys
 * @date 2020/8/23.
 */
public class KeyUtil {
    
    /**
     * 生成唯一的主键
     * 格式：时间+随机数
     *
     */
    
    public  static  synchronized  String   genUniqueKey(){
    
        Random random = new Random();
    
        Integer  number = random.nextInt(900000) + 100000;
        
        return  System.currentTimeMillis() + String.valueOf(number);
    }

}
